// 通用类型定义

// 基础类型
export type ID = string | number;


// 分页参数
export interface PageParams {
  current?: number;
  size?: number;
  [key: string]: unknown;
}

// 分页结果
export interface PageResult<T> {
  records: T[];
  total: number;
  current: number;
  pages: number;
}

// 错误处理类型
export interface ApiError {
  code: number;
  message: string;
  details?: unknown;
}

// 表格列配置类型
export interface TableColumn {
  title: string;
  dataIndex: string;
  key?: string;
  width?: number;
  fixed?: 'left' | 'right';
  sorter?: boolean;
  filters?: Array<{ text: string; value: string }>;
  render?: (value: unknown, record: unknown, index: number) => React.ReactNode;
}

// 表单字段配置类型
export interface FormField {
  name: string;
  label: string;
  type: 'input' | 'textarea' | 'select' | 'date' | 'upload' | 'number';
  required?: boolean;
  placeholder?: string;
  options?: Array<{ label: string; value: string | number }>;
  rules?: unknown[];
  props?: Record<string, unknown>;
}

// 菜单项类型
export interface MenuItem {
  key: string;
  label: string;
  icon?: React.ReactNode;
  path?: string;
  children?: MenuItem[];
  disabled?: boolean;
  hidden?: boolean;
}

// 主题配置类型
export interface ThemeConfig {
  primaryColor: string;
  borderRadius: number;
  colorBgContainer: string;
  colorText: string;
  colorTextSecondary: string;
}

// 文件上传类型
export interface UploadFile {
  uid: string;
  name: string;
  status: 'uploading' | 'done' | 'error';
  url?: string;
  response?: unknown;
}

export interface SelectOption {
  label: string;
  value: string | number;
  disabled?: boolean;
}

export interface TimeRange {
  start: string;
  end: string;
}

export interface WeeklySchedule {
  [key: string]: TimeRange[];
}

export interface Address {
  province: string;
  city: string;
  district: string;
  detail: string;
  contact: string;
  phone: string;
} 